//
//  KHHRecommendModel.m
//  Travel
//
//  Created by dllo on 15/11/29.
//  Copyright © 2015年 doll. All rights reserved.
//

#import "KHHRecommendModel.h"

@implementation KHHRecommendModel

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"poi"]) {
        //因为在数据中poi有的是字典  有的是字符串   判断poi是字符串还是字典  如果是字典 取key 为name的数据
        
        if ([[value class ] isSubclassOfClass:[NSDictionary class]] )
        {
            self.poiName = value[@"name"];
            self.icon = value[@"icon"];
            self.type = value[@"type"];
            self.poiID = value[@"id"];
        }
        
    }
    
    if ([key isEqualToString:@"id"]) {
        self.notesId = value;
        self.valueId = value;
    }
    
    
    if ([key isEqualToString:@"photo_info"]) {
        self.h = value[@"h"];
        self.w = value[@"w"];
    }
    
    
    if ([key isEqualToString:@"location"]) {
        self.latitude = value[@"latitude"];
        self.longitude = value[@"longitude"];
    }
    
    if ([key isEqualToString:@"type"]) {
        self.typeId = value;
    }
    
    
}

@end
